# -*- coding:utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator

__author__ = 'maruimin'


class LoginRequireMixin(object):
    # 使用后使得网页变得需要登录才能够访问
    @method_decorator(login_required(login_url='/login/'))
    def dispatch(self, request, *args, **kwargs):
        return super(LoginRequireMixin, self).dispatch(request, *args, **kwargs)